package com.sunbird.crm.base.manager.factory;

import com.sunbird.crm.base.utils.spring.SpringUtils;
import com.sunbird.crm.entity.sys.TLog;
import com.sunbird.crm.servce.LogService;

import java.util.TimerTask;

/**
 * @ClassName AsynFactory
 * @Descriptiom TODO 异步工厂
 * @Author Sunbird
 * @Date 2019/9/14 12:30
 * @Version 1.0
 **/
public class AsynFactory {

    /**
     * @Author Sunbird
     * @Description //操作定时任务新增操作日志
     * @Date   2019/9/14
     * @Param
     * @return
     **/

    public static TimerTask recordOper(final TLog log){
        return new TimerTask() {
            @Override
            public void run() {
                SpringUtils.getBean(LogService.class).save(log);
            }
        };
    }
}
